package com.swufe.team;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class ScoreActivity extends AppCompatActivity {
    TextView Score1, Score2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
        Score1 = (TextView) findViewById(R.id.score1);
        Score2 = (TextView) findViewById(R.id.score2);
    }
        public void Btn11 (View point){
            showScore1(1);
        }
        public void Btn12 (View point){
            showScore1(2);
        }
        public void Btn13 (View point){
            showScore1(3);
        }
        public void Btn21 (View point){
            showScore2(1);
        }
        public void Btn22 (View point){
            showScore2(2);
        }
        public void Btn23 (View point){
            showScore2(3);
        }
        public void Reset (View point){
            Score1.setText("0");
            Score2.setText("0");
        }
        private void showScore1(int inc){
        String oldScore1=(String) Score1.getText();
        int newScore= Integer.parseInt(oldScore1)+inc;
        Score1.setText(""+newScore);
        }
        private void showScore2(int inc){
        String oldScore2=(String) Score2.getText();
        int newScore= Integer.parseInt(oldScore2)+inc;
        Score2.setText(""+newScore);
    }

    }
